#ifndef CLIGHT_H
#define CLIGHT_H

#include "ILight.h"

class CPointLight : public ILight
{
private:
	//center in the world coordinates
	CVector3f m_center;	

	//center in view coordinates
	CVector3f m_viewCenter;

	CVector3f m_attenuation;
	CColor m_color;

public:
	CPointLight(const CVector3f& center, const CColor& color, const CVector3f& attenuation);
	~CPointLight();

	CColor computeColor(const CRay& ray, float dist)const;
	void computeShadowRay(const CVector3f& point, CRay& shadowRay, float* distance)const;

	//const CVector3f& getCenter()const;
	//const CColor& getColor()const;
	void applyViewMatrix(const CMatrix& view);

	//set the position
	void setPosition(const CVector3f& position);

};

#endif